<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>
        <p:dialog id="DetalleventaEditDlg" widgetVar="DetalleventaEditDialog" modal="true" resizable="false"  appendTo="@(body)" header="#{myBundle.EditDetalleventaTitle}" closeOnEscape="true">

            <h:form id="DetalleventaEditForm">

                <h:panelGroup id="display">
                    <p:panelGrid  columns="2" columnClasses="column" rendered="#{detalleventaController.selected != null}">


                        <h:outputLabel value="#{myBundle.EditDetalleventaLabel_codigo}" for="codigo" />
                        <h:outputText id="codigo" value="#{detalleventaController.selected.codigo}" />

                        <p:outputLabel value="#{myBundle.EditDetalleventaLabel_cantidad}" for="cantidad" />
                        <p:inputText id="cantidad" value="#{detalleventaController.selected.cantidad}" title="#{myBundle.EditDetalleventaTitle_cantidad}"/>

                        <p:outputLabel value="#{myBundle.EditDetalleventaLabel_codventa}" for="codventa" />
                        <p:selectOneMenu id="codventa" value="#{detalleventaController.selected.codventa}"  converter="ventaConverter">
                            <f:selectItem itemLabel="#{myBundle.SelectOneMessage}"/>
                            <f:selectItems value="#{ventaController.items}"
                                           var="codventaItem"
                                           itemValue="#{codventaItem}"
                                           itemLabel="#{codventaItem.codigo.toString()}"
                                           />

                        </p:selectOneMenu>

                        <p:outputLabel value="#{myBundle.EditDetalleventaLabel_codproducto}" for="codproducto" />
                        <p:selectOneMenu id="codproducto" value="#{detalleventaController.selected.codproducto}"  converter="productoConverter">
                            <f:selectItem itemLabel="#{myBundle.SelectOneMessage}"/>
                            <f:selectItems value="#{productoController.items}"
                                           var="codproductoItem"
                                           itemValue="#{codproductoItem}"
                                           itemLabel="#{codproductoItem.codigo.toString()}"
                                           />

                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{detalleventaController.save}" value="#{myBundle.Save}" update="display,:DetalleventaListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,DetalleventaEditDialog);">
                        <p:confirm header="#{myBundle.ConfirmationHeader}" message="#{myBundle.ConfirmEditMessage}" icon="ui-icon-alert"/>
                    </p:commandButton>
                    <p:commandButton value="#{myBundle.Cancel}" onclick="DetalleventaEditDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
